﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<IEnumerable<CodeFirstEntityConfiguration.Models.Post>>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Blog Home Page
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <table>
        <tr>
            <th>
            </th>
            <th>
                Title
            </th>
            <th>
                Body
            </th>
            <th>
                CreatedBy
            </th>
            <th>
                CreatedOn
            </th>
        </tr>
        <% foreach (var post in Model)
           { %>
        <tr>
            <td>
                <%: Html.ActionLink("Edit", "Edit", new { post.Id }) %>
                <%: Html.ActionLink("Details", "Details", new { post.Id }) %>
            </td>
            <td>
                <%: post.Title %>
            </td>
            <td>
                <%: post.Body %>
            </td>
            <td>
                <%: post.CreatedBy %>
            </td>
            <td>
                <%: String.Format("{0:dd MMM, yyy @ HH:MM}", post.CreatedOn) %>
            </td>
        </tr>
        <% } %>
    </table>
    <p>
        <%: Html.ActionLink("Create New", "Create") %>
    </p>
</asp:Content>
